import request from '@/utils/request'

// 查询成本利润分析列表
export function listProfit(query) {
  return request({
    url: '/system/profit/list',
    method: 'get',
    params: query
  })
}

// 查询成本利润分析详细
export function getProfit(id) {
  return request({
    url: '/system/profit/' + id,
    method: 'get'
  })
}

// 新增成本利润分析
export function addProfit(data) {
  return request({
    url: '/system/profit',
    method: 'post',
    data: data
  })
}

// 修改成本利润分析
export function updateProfit(data) {
  return request({
    url: '/system/profit',
    method: 'put',
    data: data
  })
}

// 删除成本利润分析
export function delProfit(id) {
  return request({
    url: '/system/profit/' + id,
    method: 'delete'
  })
}

//获取当月利润
export function profitCount() {
  return request({
    url: '/system/index/profitCount' ,
    method: 'get'
  })
}

//当月存量
export function getAllowance() {
  return request({
    url: '/system/index/getAllowance' ,
    method: 'get'
  })
}

//当月总的出货量
export function getShipping() {
  return request({
    url: '/system/index/getShipping' ,
    method: 'get'
  })
}
export function getLastWeekOrderAndAccomplishment(){
  return request({
    url: '/system/index/getLastWeekOrderAndAccomplishment' ,
    method: 'get'
  })
}